<template>
  <!-- 地图 -->
    <Map></Map>
  <!-- 操作按钮 -->
  <div class="nav">
    <NavView></NavView>
  </div>

</template>
<script setup>
import Map from "./Map/Map.vue";

import NavView from "./NavView.vue";

import { userLogoutHttp, userInfoHttp } from "@/api/user";
import { useUserStore } from "@/stores/userStore";

import { useRoute, useRouter } from "vue-router";


const route = useRoute();
const router = useRouter();

//  获取路由参数
const { type } = route.query;
const { currentUser } = useUserStore();

const handleLogout = () => {
  //  退出登录逻辑
  userLogoutHttp({ username: currentUser.username, type: type });
  router.push({ name: "login" });
  //  清除用户信息
  localStorage.removeItem("token");
  localStorage.removeItem("currentUser");
};

</script>
<style scoped>
.nav {
  position: fixed;
  top: 0;
  left: 0;
}
</style>
